<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>美嘉饲料</title>
<script type="text/javascript" src="<%=basePath%>skin/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/common.js"></script>
</head>
  
<body>
<c:import url="../left.jsp" />
我的订单
<form action="<%=basePath%>member/return/orderList.shtml" id="form1" name="form1" method="get">
	<table>
		<tr>
			<td align="right"><select name="field">
					<option value="sn">编号</option>
			</select> <input name="keyword" type="text" id="keyword"
				value="${paramBean.keyword }" size="20" /> <input type="submit"
				name="add" value="查询" /></td>
		</tr>
	</table>
</form>
<c:choose>
	<c:when test="${empty pagination || empty pagination.recordList || pagination.recordCount < 1}"></c:when>
	<c:otherwise>
		<table>
				<tr>
					<td>编号</td>
					<td>商品</td>
					<td>收货人</td>
					<td>金额</td>
					<td>创建日期</td>
					<td>状态</td>
				</tr>
				<c:forEach items="${pagination.recordList }" var="order">
				<tr>
					<td>${order.sn }</td>
					<td>
					<c:forEach items="${order.orderItems }" var="orderItem">
						${orderItem.name } <a href="<%=basePath%>member/return/request.shtml?id=${order.id}&pid=${orderItem.product.id }">申请</a>
					</c:forEach>
					</td>
					<td>${order.consignee }</td>
					<td><fmt:formatNumber value="${order.amount}" pattern="0.00"/></td>
					<td><fmt:formatDate value="${order.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
					<td>${order.sn }</td>
				</tr>
				</c:forEach>
				<tr align="right" bgcolor="#EEF4EA">
					<td height="36" colspan="12" align="center">
						${pagination.pageHtml }
					</td>
				</tr>
		</table>	
	</c:otherwise>
</c:choose>
<table>
	<tr>
		<td>
			<input type="button" value="返回" class="button" onclick="location.href='<%=basePath%>member/index.shtml'" >
		</td>
	</tr>
</table>
</body>
</html>
